#pragma once

#include <Windows.h>
#include <TlHelp32.h>

#include <string>

#include "platform.h"
#include "Process.h"
#include "ProcessModule.h"
#include "ProcessWinHandleToID.h"
#include "MemoryReaderWin.h"

class ProcessWin : public Process
{
public:
	static ProcessPtr fromHandleAndName(const process_handle handle, const std::string& name_);

	virtual std::vector<ProcessModule>& modules();

	virtual const process_handle native() const;

	virtual const std::string& name() const;

	virtual MemoryReader& reader();

protected: // functions
	ProcessWin(const process_handle handle, const std::string& name_);

	void fillModules();

protected: // members
	process_handle handle;
	std::vector<ProcessModule> modules_;
	std::string name_;
	bool modules_loaded;
	MemoryReaderWin memreader;
};